#include "main.h"

static void resize_(unsigned right, unsigned bottom)
{
	unsigned static_height = 15;
	unsigned hint_static_width = 220;
	unsigned x0 = right / 3;
	unsigned y0 = bottom / 2;
	
	set_pos(static_bottom.handle, x0, y0, hint_static_width, static_height);
}

static LRESULT CALLBACK input_wndproc(HWND hwnd,
	UINT msg, WPARAM wParam, LPARAM lParam)
{
	static BOOL monitor_clipboard = TRUE;
	
	if (msg != WM_CREATE)
		clipboard_monitor(msg, wParam, lParam);
	
	switch (msg)
	{
		case WM_DESTROY:
			PostQuitMessage(0);
			break;
		
		case WM_SIZE:
			resize();
			break;
		
		case WM_PAINT:
			break;
		
		case WM_DRAWCLIPBOARD:
			check_input();
			break;

		default:
			return DefWindowProc(hwnd, msg, wParam, lParam);
	}
	
	return 0;
}

extern void init_input_UI(void)
{
	SetWindowLong(main_window, GWL_WNDPROC, input_wndproc);
	resize();
}